﻿using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.IO;
using System.Threading;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Net;
using Android.Provider;

namespace MWC
{
    public static class NetcampAlerts
    {
        public static void NoInternet(Activity activity, bool exitApplication)
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(activity);
            AlertDialog alertDialog = builder.Create();
            alertDialog.SetTitle("Netcamp");
            alertDialog.SetMessage("Aplikacja twierdzi, że nie ma dostępu internetu. To prawda? :)");
            if (exitApplication == true)
            {
                alertDialog.SetButton("OK", (s, ev) =>
                {
                    activity.Finish();
                });
            }
            else
            {
                alertDialog.SetButton("OK", (s, ev) =>
                {
                    alertDialog.Dismiss();
                });
            }
            alertDialog.Show();
        }
        public static void UnknownError(Activity activity)
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(activity);
            AlertDialog alertDialog = builder.Create();
            alertDialog.SetTitle("Netcamp");
            alertDialog.SetMessage("Przepraszamy. Wystąpił nieoczekiwany błąd i wymagane jest zamknięcie aplikacji.");

            alertDialog.SetButton("OK", (s, ev) =>
            {
                activity.Finish();
            });

            alertDialog.Show();
        }
        public static void ThankForFeedback(Activity activity)
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(activity);
            AlertDialog alertDialog = builder.Create();
            alertDialog.SetTitle("Netcamp");
            alertDialog.SetMessage("Dziękujemy za wypełnienie ankiety :)");
            alertDialog.SetButton("OK", (s, ev) =>
            {
                activity.Finish();
            });
            alertDialog.Show();
        }
        public static void WeWillSendEmail(Activity activity)
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(activity);
            AlertDialog alertDialog = builder.Create();
            alertDialog.SetTitle("Netcamp");
            alertDialog.SetMessage("Dziekujemy. Na Twój adres email prześlemy informacje o spotkaniu jak tylko będzie zaplanowane");
            alertDialog.SetButton("OK", (s, ev) =>
            {
                alertDialog.Dismiss();
            });
            alertDialog.Show();
        }

        public static void TurnOnGPS(Activity activity)
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(activity);
            AlertDialog alertDialog = builder.Create();
            alertDialog.SetTitle("Netcamp");
            alertDialog.SetMessage("Czy chcesz uruchomić GPS?");
            alertDialog.SetButton("Tak", (s, e) =>
                {
                    Intent i = new Intent(Settings.ActionLocationSourceSettings);
                    activity.StartActivity(i);
                });
            alertDialog.SetButton("Nie", (s, e) =>
                {
                    alertDialog.Dismiss();
                });
            alertDialog.Show();
        }
    }
}